<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        对象 instanceof 类|构造函数|数据类型 
        1. 我是哪个类构造出来的 ❌
        2. 判断构造函数或类的prototype是否在对象的原型链上，在就返回ture，否则返回false √
        缺点： 只对对象类型进行判断
      */

      class Human {}
      class Person extends Human {}
      const p = new Person(); // Person
      console.log(p instanceof Person);
      console.log(p instanceof Human); //true
      console.log(p instanceof Object); //true
      console.log([] instanceof Object); //true
      console.log(function () {} instanceof Object); //true

      // console.log([] instanceof Array);
      // console.log({} instanceof Object);
      // console.log(100 instanceof Number);
    </script>
  </body>
</html>
